<!doctype html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta content="width=device-width, user-scalable=no, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0"
          name="viewport">
    <meta content="ie=edge" http-equiv="X-UA-Compatible">
    <title>Document</title>
    <style>

        body {
            background-color: #000;
        }

        .container {
            height: 300px;
            width: 300px;
            margin: 50px;
        }

        .person {
            position: absolute;
            left: 150px;
            top: 160px;
            animation: sprint 3s infinite ease-in;
        }

        .head {
            position: absolute;
            width: 30px;
            height: 30px;
            border: 5px solid #fff;
            border-radius: 50%;
            top: -30px;
            left: -6px;
            animation: bob 2s infinite alternate;
        }

        .torso {
            width: 0;
            height: 60px;
            border-left: 5px solid #fff;
            position: absolute;
            left: 0;
            top: 15px;
        }

        .person .part {
            position: absolute;
            left: 0;
            top: 75px;
        }

        .person .part.arm {
            width: 40px;
            height: 45px;
            border-left: 5px solid #fff;
            border-bottom: 5px solid #fff;
            position: absolute;
            top: 15px;
            right: 300px;
            transform-origin: 0% 0% 0px;
            animation: pump 1s infinite ease-in-out;
        }

        .person .part.arm.one {
            transform: rotate3d(0, 0, 1, 80deg);
        }

        .person .part.arm.two {
            transform: rotate3d(0, 0, 1, -80deg);
            animation-delay: 0.5s;
        }

        .person .part.leg {
            height: 60px;
            width: 60px;
            border-right: 5px solid #fff;
            border-top: 5px solid #fff;
            transform-origin: 0% 0% 0px;
            animation: run 1s infinite ease-in;
        }

        .person .part.leg.one {
            transform: rotate3d(0, 0, 1, 100deg);
        }

        .person .part.leg.two {
            transform: rotate3d(0, 0, 1, 10deg);
            animation-delay: 0.5s;
        }

        /* 头部动起来 */
        @keyframes bob {
            0% {
                transform: rotate3d(0, 0, 1, 5deg);
            }
            25% {
                transform: rotate3d(0, 0, 1, -30deg) skew(15deg, 0deg);
            }
            50% {
                transform: rotate3d(0, 0, 1, 5deg);
            }
            75% {
                transform: rotate3d(0, 0, 1, -30deg) skew(15deg, 0deg);
            }
            100% {
                transform: rotate3d(0, 0, 1, 20deg) skew(-15deg, 0deg);
            }
        }

        /* 胳膊摆动 */
        @keyframes pump {
            0% {
                transform: rotate3d(0, 0, 1, 80deg);
            }
            50% {
                transform: rotate3d(0, 0, 1, -70deg);
            }
            100% {
                transform: rotate3d(0, 0, 1, 80deg);
            }
        }

        /* 腿跑起来 */
        @keyframes run {
            0% {
                transform: rotate3d(0, 0, 1, -5deg);
            }
            50% {
                transform: rotate3d(0, 0, 1, 150deg);
            }
            100% {
                transform: rotate3d(0, 0, 1, -5deg);
            }
        }

        /* 让人物向前跑起来 */
        @keyframes sprint {
            0% {
                transform: translate(-200px, 0px);
            }
            100% {
                transform: translate(1800px, 0px);
            }
        }

    </style>
</head>
<body>

<!-- 火柴人结构 -->
<div class="container">
    <div class="person">
        <div class="head"></div>
        <div class="part arm one"></div>
        <div class="part arm two"></div>
        <div class="torso"></div>
        <div class="part leg one"></div>
        <div class="part leg two"></div>
    </div>
</div>

</body>
</html>